home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Dev / Lang / Nano.lha / nano / prog / circle_l.n < prev    next >
Encoding:
Text File  |  2002-07-24  |  795 b   |  45 lines

  1. // multi-language demo
  2.  
  3. #include <math.h>
  4.  
  5. double d; double c;
  6. string inp[80];
  7. string msg[80]; string diam[80]; string circ[80];
  8. int lang;
  9.  
  10. lang = 0;
  11. if _lang = "English"; lang = 1; endif;
  12. if _lang = "German"; lang = 2; endif;
  13.  
  14.  
  15. // set a default language, if the config-language is not supported
  16. // English in this example:
  17.  
  18. if lang = 0; lang = 1; endif;
  19.  
  20.  
  21. // set the message variables:
  22.  
  23. if lang = 1;
  24.     msg = "RETURN to exit";
  25.     diam = "diameter:        ";
  26.     circ = "circumference:   ";
  27. endif;
  28. if lang = 2;
  29.     msg = "RETURN zum Beenden";
  30.     diam = "Durchmesser:     ";
  31.     circ = "Umfang:          ";
  32. endif;
  33.  
  34. print /n;
  35. print msg, /n2;
  36. inp = " ";
  37. while inp != "";
  38.     input diam inp;
  39.     if inp != "";
  40.         val d inp;
  41.         c = M_PI * d;
  42.         print circ, c, /n2;
  43.     endif;
  44. wend;
  45.